package com.artron.mediaartron.data.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;
import java.util.List;

/**
 * Class description here
 *
 * @author doing
 * @version 1.0.0
 * @since 2017-11-03.
 */

public class OrderDetailData implements Parcelable {


    /**
     * consigneeDetailAddress : 广东省深圳市福田区étude hue
     * orderId : 8b70b944de894a10b8baf0b3e290b7a3
     * totalPrice : 299
     * worksList : [{"worksTypeCode":"kuanghua","worksColor":"","worksQuantity":1,"worksId":"2817fd42c5b54747a2d13550cbeb201b","worksName":null,"thumbnailPath":"http://test2.artup.com/edited/final/2017/11/3/45384e41fed4448bae34fafbb3053d21/1a7246774f0345389c798d17e84bcd02_200.jpg","worksSize":"500X500","worksPrice":299,"worksShape":"银平面铝框"}]
     * couponDiscountAmount : 0
     * consigneeMobileCode : 3576466544
     * consigneeName : cccccccccccc
     * totalQuantity : 0
     * orderCode : 201711031500555879
     * payment : {"id":"c296018b3bc3486eae2c3b087af4b338","orderId":"8b70b944de894a10b8baf0b3e290b7a3","type":null,"remark":"直接购买订单","payTime":null,"payFinishDate":null,"status":1}
     * couponCode :
     * passportId : 45384e41fed4448bae34fafbb3053d21
     * createDate : 2017-11-03 15:00:13
     * status : 1
     */

    private String consigneeDetailAddress;
    private String orderId;
    private int totalPrice;
    private int couponDiscountAmount;
    private String consigneeMobileCode;
    private String consigneeName;
    private int totalQuantity;
    private String orderCode;
    /**
     * id : c296018b3bc3486eae2c3b087af4b338
     * orderId : 8b70b944de894a10b8baf0b3e290b7a3
     * type : null
     * remark : 直接购买订单
     * payTime : null
     * payFinishDate : null
     * status : 1
     */

    private PaymentBean payment;
    private String couponCode;
    private String passportId;
    private String createDate;
    private int status;

    /**
     * worksTypeCode : kuanghua
     * worksColor :
     * worksQuantity : 1
     * worksId : 2817fd42c5b54747a2d13550cbeb201b
     * worksName : null
     * thumbnailPath : http://test2.artup.com/edited/final/2017/11/3/45384e41fed4448bae34fafbb3053d21/1a7246774f0345389c798d17e84bcd02_200.jpg
     * worksSize : 500X500
     * worksPrice : 299
     * worksShape : 银平面铝框
     */

    private List<WorksListBean> worksList;
    /**
     * cardDiscountAmount : 0
     * invoice : {"id":2339,"passportId":"45384e41fed4448bae34fafbb3053d21","title":"结构送","content":"框画"}
     */

    private int cardDiscountAmount;
    /**
     * id : 2339
     * passportId : 45384e41fed4448bae34fafbb3053d21
     * title : 结构送
     * content : 框画
     */

    private InvoiceBean invoice;

    public String getConsigneeDetailAddress() {
        return consigneeDetailAddress;
    }


    public void setConsigneeDetailAddress(String consigneeDetailAddress) {
        this.consigneeDetailAddress = consigneeDetailAddress;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public int getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(int totalPrice) {
        this.totalPrice = totalPrice;
    }

    public int getCouponDiscountAmount() {
        return couponDiscountAmount;
    }

    public void setCouponDiscountAmount(int couponDiscountAmount) {
        this.couponDiscountAmount = couponDiscountAmount;
    }

    public String getConsigneeMobileCode() {
        return consigneeMobileCode;
    }

    public void setConsigneeMobileCode(String consigneeMobileCode) {
        this.consigneeMobileCode = consigneeMobileCode;
    }

    public String getConsigneeName() {
        return consigneeName;
    }

    public void setConsigneeName(String consigneeName) {
        this.consigneeName = consigneeName;
    }

    public int getTotalQuantity() {
        return totalQuantity;
    }

    public void setTotalQuantity(int totalQuantity) {
        this.totalQuantity = totalQuantity;
    }

    public String getOrderCode() {
        return orderCode;
    }

    public void setOrderCode(String orderCode) {
        this.orderCode = orderCode;
    }

    public PaymentBean getPayment() {
        return payment;
    }

    public void setPayment(PaymentBean payment) {
        this.payment = payment;
    }

    public String getCouponCode() {
        return couponCode;
    }

    public void setCouponCode(String couponCode) {
        this.couponCode = couponCode;
    }

    public String getPassportId() {
        return passportId;
    }

    public void setPassportId(String passportId) {
        this.passportId = passportId;
    }

    public String getCreateDate() {
        return createDate;
    }

    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public List<WorksListBean> getWorksList() {
        return worksList;
    }

    public void setWorksList(List<WorksListBean> worksList) {
        this.worksList = worksList;
    }

    public int getCardDiscountAmount() {
        return cardDiscountAmount;
    }

    public void setCardDiscountAmount(int cardDiscountAmount) {
        this.cardDiscountAmount = cardDiscountAmount;
    }

    public InvoiceBean getInvoice() {
        return invoice;
    }

    public void setInvoice(InvoiceBean invoice) {
        this.invoice = invoice;
    }

    public static class PaymentBean implements Parcelable {
        private String id;
        private String orderId;
        private String type;
        private String remark;
        private String payTime;
        private String payFinishDate;
        private int status;

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getOrderId() {
            return orderId;
        }

        public void setOrderId(String orderId) {
            this.orderId = orderId;
        }

        public Object getType() {
            return type;
        }

        public void setType(String type) {
            this.type = type;
        }

        public String getRemark() {
            return remark;
        }

        public void setRemark(String remark) {
            this.remark = remark;
        }

        public Object getPayTime() {
            return payTime;
        }

        public void setPayTime(String payTime) {
            this.payTime = payTime;
        }

        public Object getPayFinishDate() {
            return payFinishDate;
        }

        public void setPayFinishDate(String payFinishDate) {
            this.payFinishDate = payFinishDate;
        }

        public int getStatus() {
            return status;
        }

        public void setStatus(int status) {
            this.status = status;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.id);
            dest.writeString(this.orderId);
            dest.writeString(this.type);
            dest.writeString(this.remark);
            dest.writeString(this.payTime);
            dest.writeString(this.payFinishDate);
            dest.writeInt(this.status);
        }

        public PaymentBean() {
        }

        protected PaymentBean(Parcel in) {
            this.id = in.readString();
            this.orderId = in.readString();
            this.type = in.readString();
            this.remark = in.readString();
            this.payTime = in.readString();
            this.payFinishDate = in.readString();
            this.status = in.readInt();
        }

        public static final Creator<PaymentBean> CREATOR = new Creator<PaymentBean>() {
            @Override
            public PaymentBean createFromParcel(Parcel source) {
                return new PaymentBean(source);
            }

            @Override
            public PaymentBean[] newArray(int size) {
                return new PaymentBean[size];
            }
        };
    }

    public static class WorksListBean implements Parcelable {
        private String worksTypeCode;
        private String worksColor;
        private int worksQuantity;
        private String worksId;
        private String worksName;
        private String thumbnailPath;
        private String worksSize;
        private int worksPrice;
        private String worksShape;

        public String getWorksTypeCode() {
            return worksTypeCode;
        }

        public void setWorksTypeCode(String worksTypeCode) {
            this.worksTypeCode = worksTypeCode;
        }

        public String getWorksColor() {
            return worksColor;
        }

        public void setWorksColor(String worksColor) {
            this.worksColor = worksColor;
        }

        public int getWorksQuantity() {
            return worksQuantity;
        }

        public void setWorksQuantity(int worksQuantity) {
            this.worksQuantity = worksQuantity;
        }

        public String getWorksId() {
            return worksId;
        }

        public void setWorksId(String worksId) {
            this.worksId = worksId;
        }

        public String getWorksName() {
            return worksName;
        }

        public void setWorksName(String worksName) {
            this.worksName = worksName;
        }

        public String getThumbnailPath() {
            return thumbnailPath;
        }

        public void setThumbnailPath(String thumbnailPath) {
            this.thumbnailPath = thumbnailPath;
        }

        public String getWorksSize() {
            return worksSize;
        }

        public void setWorksSize(String worksSize) {
            this.worksSize = worksSize;
        }

        public int getWorksPrice() {
            return worksPrice;
        }

        public void setWorksPrice(int worksPrice) {
            this.worksPrice = worksPrice;
        }

        public String getWorksShape() {
            if ("外观尺寸".equals(worksShape)) {
                return "";
            }

            return worksShape;
        }

        public void setWorksShape(String worksShape) {
            this.worksShape = worksShape;
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeString(this.worksTypeCode);
            dest.writeString(this.worksColor);
            dest.writeInt(this.worksQuantity);
            dest.writeString(this.worksId);
            dest.writeString(this.worksName);
            dest.writeString(this.thumbnailPath);
            dest.writeString(this.worksSize);
            dest.writeInt(this.worksPrice);
            dest.writeString(this.worksShape);
        }

        public WorksListBean() {
        }

        protected WorksListBean(Parcel in) {
            this.worksTypeCode = in.readString();
            this.worksColor = in.readString();
            this.worksQuantity = in.readInt();
            this.worksId = in.readString();
            this.worksName = in.readString();
            this.thumbnailPath = in.readString();
            this.worksSize = in.readString();
            this.worksPrice = in.readInt();
            this.worksShape = in.readString();
        }

        public static final Creator<WorksListBean> CREATOR = new Creator<WorksListBean>() {
            @Override
            public WorksListBean createFromParcel(Parcel source) {
                return new WorksListBean(source);
            }

            @Override
            public WorksListBean[] newArray(int size) {
                return new WorksListBean[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.consigneeDetailAddress);
        dest.writeString(this.orderId);
        dest.writeInt(this.totalPrice);
        dest.writeInt(this.couponDiscountAmount);
        dest.writeString(this.consigneeMobileCode);
        dest.writeString(this.consigneeName);
        dest.writeInt(this.totalQuantity);
        dest.writeString(this.orderCode);
        dest.writeParcelable(this.payment, flags);
        dest.writeString(this.couponCode);
        dest.writeString(this.passportId);
        dest.writeString(this.createDate);
        dest.writeInt(this.status);
        dest.writeList(this.worksList);
    }

    public OrderDetailData() {
    }

    protected OrderDetailData(Parcel in) {
        this.consigneeDetailAddress = in.readString();
        this.orderId = in.readString();
        this.totalPrice = in.readInt();
        this.couponDiscountAmount = in.readInt();
        this.consigneeMobileCode = in.readString();
        this.consigneeName = in.readString();
        this.totalQuantity = in.readInt();
        this.orderCode = in.readString();
        this.payment = in.readParcelable(PaymentBean.class.getClassLoader());
        this.couponCode = in.readString();
        this.passportId = in.readString();
        this.createDate = in.readString();
        this.status = in.readInt();
        this.worksList = new ArrayList<WorksListBean>();
        in.readList(this.worksList, WorksListBean.class.getClassLoader());
    }

    public static final Creator<OrderDetailData> CREATOR = new Creator<OrderDetailData>() {
        @Override
        public OrderDetailData createFromParcel(Parcel source) {
            return new OrderDetailData(source);
        }

        @Override
        public OrderDetailData[] newArray(int size) {
            return new OrderDetailData[size];
        }
    };

    public static class InvoiceBean {
        private int id;
        private String passportId;
        private String title;
        private String content;

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public String getPassportId() {
            return passportId;
        }

        public void setPassportId(String passportId) {
            this.passportId = passportId;
        }

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }

        public String getContent() {
            return content;
        }

        public void setContent(String content) {
            this.content = content;
        }
    }
}
